home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / amd64-microcode.postinst < prev    next >
Encoding:
Text File  |  2012-10-09  |  1.9 KB  |  58 lines

  1. #!/bin/sh
  2. # postinst script for amd64-microcode
  3. #
  4. # see: dh_installdeb(1)
  5.  
  6. set -e
  7.  
  8. # summary of how this script can be called:
  9. #        * <postinst> `configure' <most-recently-configured-version>
  10. #        * <old-postinst> `abort-upgrade' <new version>
  11. #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  12. #          <new-version>
  13. #        * <postinst> `abort-remove'
  14. #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  15. #          <failed-install-package> <version> `removing'
  16. #          <conflicting-package> <version>
  17. # for details, see http://www.debian.org/doc/debian-policy/ or
  18. # the debian-policy package
  19.  
  20. case "$1" in
  21.     configure)
  22.     if [ -e /sys/devices/system/cpu/microcode/reload ] ; then
  23.         echo "Updating microcode on all online processors..." >&2
  24.         echo 1 > /sys/devices/system/cpu/microcode/reload || {
  25.             echo "Kernel reported failure while updating microcode!" >&2
  26.             }
  27.     else
  28.         # Try all online processors, broken kernels need this,
  29.         # fixed kernels will accept it only on the BSP and update
  30.         # all processors anyway, and -EINVAL all others... but we
  31.         # don't know which one is the BSP, so we try all of them
  32.         # and hide errors, the kernel will log any real problem.
  33.         echo "Using per-core interface to update microcode on online processors..." >&2
  34.         find /sys/devices/system/cpu -noleaf -type f -path '/sys/devices/system/cpu/cpu*/microcode/reload' | \
  35.         while read i ; do echo -n 1 2>/dev/null >"$i" || true ; done
  36.     fi
  37.     # do it like udev and firmware-linux-*
  38.     if [ -x /usr/sbin/update-initramfs -a -e /etc/initramfs-tools/initramfs.conf ] ; then
  39.         update-initramfs -u
  40.     fi
  41.     ;;
  42.  
  43.     abort-upgrade|abort-remove|abort-deconfigure)
  44.     ;;
  45.  
  46.     *)
  47.         echo "postinst called with unknown argument \`$1'" >&2
  48.         exit 1
  49.     ;;
  50. esac
  51.  
  52. # dh_installdeb will replace this with shell code automatically
  53. # generated by other debhelper scripts.
  54.  
  55.  
  56.  
  57. exit 0
  58.